const App = getApp()
const db = wx.cloud.database()
const _ = db.command
Page({

  /**
   * 页面的初始数据
   */
  data: {
    list: [{
        pagePath: '/pages/teachers/home/index',
        iconPath: "../../images/icon/home.png",
        color: "text-gray",
        text: '首页',
      },
      {
        pagePath: '/pages/teachers/practice/index/index',
        iconPath: "../../images/icon/practice-action.png",
        color: "text-blue",
        text: '实践',
      },
      {
        pagePath: '/pages/teachers/smartService/index',
        iconPath: "../../images/icon/teaching.png",
        color: "text-gray",
        text: '服务',
      },
      {
        pagePath: '/pages/teachers/my/index',
        iconPath: "../../images/icon/my.png",
        color: "text-gray",
        text: '我的',

      }
    ],
    swiperList: [{
      id: 0,
      type: 'image',
      url: '//tvax2.sinaimg.cn/large/006mYJfIgy1gztnhco8m7j30u00jggmd.jpg'
    }, {
      id: 1,
      type: 'image',
      url: '//tva2.sinaimg.cn/large/006mYJfIgy1gztnghp5yhj30u00jgq39.jpg',
    }, {
      id: 2,
      type: 'image',
      url: '//tvax2.sinaimg.cn/large/006mYJfIgy1gztngpwlr3j30u00jg3yt.jpg'
    }, {
      id: 3,
      type: 'image',
      url: '//tvax1.sinaimg.cn/large/006mYJfIgy1gztnh0sw0xj30u00jgwf5.jpg'
    }, {
      id: 4,
      type: 'image',
      url: '//tva2.sinaimg.cn/large/006mYJfIgy1gztnfv7ogdj30u00jgmxd.jpg'
    }],
    boxList: [{
      title: "任务发布",
      text: "实践任务发布",
      bgPath: "/pages/teachers/practice/add/index",
      icon: "icon-tubiao_tijiao",
      color: "repeating-linear-gradient(45deg, #CA26FF, #F360A7)"
    }, {
      title: "任务列表",
      text: "选择实践基地管理",
      bgPath: "/pages/teachers/practice/list/index",
      icon: "icon-renwufabu",
      color: "repeating-linear-gradient(45deg, #ED1C24, #FECE12)"
    }, {
      title: "实践作业评分",
      text: "选择实践作业评分",
      bgPath: "/pages/teachers/practice/list/index",
      icon: "icon-pingfen",
      color: "repeating-linear-gradient(45deg, #ED1C24, #FECE12)"
    }, ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    if (typeof this.getTabBar === 'function' &&
      this.getTabBar()) {
      this.getTabBar().setData({
        active: 2
      })
    }
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  practiceRoute(e) {
    let path = e.currentTarget.dataset.path
    App.route.navTo(path)
  }
})